<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta charset="utf-8" />
		<title>用户组列表 - FCMS后台管理</title>
				<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<link href="/fcms/Public/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/font-awesome.min.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="/fcms/Public/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- fonts -->

		<!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" /> -->

		<!-- ace styles -->

		<link rel="stylesheet" href="/fcms/Public/assets/css/ace.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/fcms.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/fcms/Public/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="/fcms/Public/assets/js/ace-extra.min.js"></script>

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="/fcms/Public/assets/js/html5shiv.js"></script>
		<script src="/fcms/Public/assets/js/respond.min.js"></script>
		<![endif]-->
		
	</head>
	<body>
		<div class="wrap">
			<div class="col-sm-12 col-xs-12">
				<div class="table-responsive">
					<table id="sample-table-2" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>编号</th>
								<th>名称</th>
								<th>描述</th>
								<th>附加</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
	
						<tbody>
							<?php if(is_array($rule)): foreach($rule as $key=>$vo): ?><tr>
									<td class="center">
										<label>
											<input type="checkbox" name="id" class="ace" value="<?php echo ($vo["id"]); ?>" />
											<span class="lbl"></span>
										</label>
									</td>
									<td>
										<?php echo ($vo["id"]); ?>
									</td>
									<td>
										<?php echo ($vo["name"]); ?>
									</td>
									<td>
										<?php echo ($vo["title"]); ?>
									</td>
									<td>
										<?php echo ($vo["condition"]); ?>
									</td>
									<!--<td>
										<?php if(is_array($types)): foreach($types as $key=>$type): if($vo['type'] == $type['id']): echo ($type["name"]); endif; endforeach; endif; ?>
									</td>-->
									<td>
										<?php if($vo['status'] == 1): ?><span class="label label-sm label-success">可用</span>
										<?php else: ?>
											<span class="label label-sm label-warning">禁用</span><?php endif; ?>
									</td>
	
									<td>
										<div class="visible-md visible-lg visible-sm visible-xs btn-group">
											<?php if($vo['status'] == 1): ?><a title="改为禁用" class="btn btn-xs btn-warning" href="<?php echo U('updateStatus',array('id'=>$vo['id'],'m'=>'auth_rule'));?>">
													<i class="icon-eye-close bigger-120"></i>
												</a>
											<?php else: ?>
												<a title="改为可用" class="btn btn-xs btn-success" href="<?php echo U('updateStatus',array('id'=>$vo['id'],'m'=>'auth_rule'));?>">
													<i class="icon-eye-open bigger-120"></i>
												</a><?php endif; ?>
											<a title="编辑" class="btn btn-xs btn-info" href="<?php echo U('editRule','id='.$vo['id']);?>">
												<i class="icon-edit bigger-120"></i>
											</a>
											<a title="删除" class="btn btn-xs btn-danger" href="<?php echo U('deleteRule','id='.$vo['id']);?>">
												<i class="icon-trash bigger-120"></i>
											</a>
										</div>
									</td>
								</tr><?php endforeach; endif; ?>
						</tbody>
					</table>
				</div>

		</div><!-- /row -->

		<!-- basic scripts -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='/fcms/Public/assets/js/jquery-2.0.3.min.js'>"+"<"+"script>");
		</script>


		<!--[if IE]>
		<script type="text/javascript">
		 window.jQuery || document.write("<script src='/fcms/Public/assets/js/jquery-1.10.2.min.js'>"+"<"+"script>");
		</script>
		<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='/fcms/Public/assets/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
		</script>
		<script src="/fcms/Public/assets/js/bootstrap.min.js"></script>
		<script src="/fcms/Public/assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="/fcms/Public/assets/js/excanvas.min.js"></script>
		<![endif]-->

		<!-- ace scripts -->

		<script src="/fcms/Public/assets/js/ace-elements.min.js"></script>
		<script src="/fcms/Public/assets/js/ace.min.js"></script>

		<script src="/fcms/Public/assets/js/jquery.dataTables.min.js"></script>
		<script src="/fcms/Public/assets/js/jquery.dataTables.bootstrap.js"></script>

		<script type="text/javascript">
			$(function() {
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      null, null,null, null, null,
				  { "bSortable": false }
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
		</script>
</body>
</html>